import React from "react";
import "../../i18n/config";
import { useTranslation } from "react-i18next";
function Css() {
  const { t, i18n } = useTranslation();
  const ChangeLang = () => {
    i18n.changeLanguage(i18n.language === "zh" ? "en" : "zh");
  };
  return (
    <div className="top">
      <h1>
        {t("name")} {t("age")} {t("classname")}
      </h1>
      <button onClick={ChangeLang}>
        切换语言 : {i18n.language === "zh" ? "英文" : "中文"}
      </button>
    </div>
  );
}

export default Css;
